package j2025.j02;

/**
 * @Author 猫大仙
 */
public class j0224 {
    public int maxArea(int[] height) {
        int n = height.length;
        int left = 0,right = n-1;
        int ret = 0;
        while(left<right){
            int tmp = (right-left)*Math.min(height[left],height[right]);
            ret = Math.max(ret, tmp);
            if(height[left]<height[right]){
                left++;
            }else {
                right--;
            }
        }
        return ret;
    }
}
